import datetime

from pydantic import BaseModel, Field
from typing import Optional, List


class OrderExecuteModel(BaseModel):
    id: Optional[int] = Field(None, primary_key=True)
    state: Optional[int] = Field(None, comment='状态（0 失效，1 有效）')
    create_time: Optional[datetime.datetime] = Field(None, comment='创建时间-调度时间')
    order_id: Optional[str] = Field(None, comment='单号')
    car_id: Optional[str] = Field(None, comment='车辆编码')
    driver_id: Optional[str] = Field(None, comment='驾驶员编码')
    rading_count: Optional[int] = Field(None, comment='乘坐人数')
    reality_begin_time: Optional[datetime.datetime] = Field(None, comment='实际出车时间')
    reality_end_time: Optional[datetime.datetime] = Field(None, comment='实际回车时间')
    start_mileage: Optional[float] = Field(None, comment='任务开始里程')
    end_mileage: Optional[float] = Field(None, comment='任务结束里程')
    sheet_mileage: Optional[float] = Field(None, comment='仪表里程')
    start_file: Optional[str] = Field(None, comment='任务开始附件')
    end_file: Optional[str] = Field(None, comment='任务结束附件')
    sign: Optional[str] = Field(None, comment='签名')
    create_by: Optional[str] = Field(None, comment='创建人')
    update_time: Optional[datetime.datetime] = Field(None, comment='修改时间')
    update_by: Optional[str] = Field(None, comment='修改人')
    #
    bill_type: Optional[str] = Field(None, comment='结算类型 北斗系统结算 表显里程结算')
    expenses: Optional[Optional[float]] = Field(None, comment='系统里程费用')
    sheet_expenses: Optional[Optional[float]] = Field(None, comment='仪表里程费用')
